#pragma once

#include <QObject>
#include <qlabel.h>
#include <qmap.h>
#include <qscrollarea.h>

class LyricsController  : public QObject
{
	Q_OBJECT

public:
	LyricsController(QScrollArea * controllWidget  ,QObject *parent);
	~LyricsController();

	void setLyric(QString* rawLyric);
	void focusByPlaytime(int time);
	

private:
	void initLabelsInWidget();
	void clearLyricLabels();

	static const QString LYRIC_REGEX_PATTERN;
	

	QWidget* m_lyricWidget;
	QScrollArea* m_lyricScrollArea;
	QMap<qint64,QLabel*> m_lyricTimeLabels;
	qint64 m_curFocusLyricTime = 0;
};
